#   1. 有一些数存于列表中,如:
#     L = [1, 3, 2, 1, 6, 4, 2, 27, 98, 82]
#     1) 将列表中出现的数字存入到另一个列表L2中,
#       要求:
#         重复出现多次的数字只在L2列表中保留一份(去重)
#     2) 将列表中出现两次的数字存于L3列表中,在L3列表中保留一份



L = [1, 3, 2, 1, 6, 4, 2, 27, 98, 82]

L2 = []
for x in L:
    if x not in L2:
        L2.append(x)

print("L2=", L2) # L2 = [1, 3, 2, 6, 4, 27, 98, 82]

# 2) 将列表中出现两次的数字存于L3列表中,在L3列表中保留一份
L3 = []
for x in L:
    if x not in L3 and L.count(x) == 2:
        L3.append(x)

print("L3=", L3)  # L3=[1, 2]
